Curve

If your browser is not Java-enabled, this page will look very boring. This applet was compiled with the beta 1.0 release of Java, so will not be viewable with HotJava.

Instructions

Use the radio buttons at the bottom of the applet to select the curve-point mode. In add mode, clicking on the display will add a curve control point. In delete mode, when you click on a control point, it will be removed. In move mode, you can click and drag control points.

When there are enough control points (4 or more), they will be used to plot a curve of the selected type. Select the curve type from the radio buttons on the top of the applet. The clear button will remove all the control points. This applet is a port of a MS-Visual Basic application.

New! Precision Scrollbar

If any of you looked at my old code, you would have found hooks in the code to add the ability to control the precision of the curve. I finally got around to looking at how scrollbars work in Java, and here it is. The most difficult part of adding a scrollbar is knowing that Scrollbar events are not ACTION_EVENT's, and cannot be handled from the action() method. Put all the event handlers in the handleEvent() method, and everything works great.


Note: Since the new Netscape 2.0b2 for Solaris, SunOS, and SGI does not correctly display drop-down lists, I have had to change the interface to allow curve-type to be selected by radio-button instead of drop-down list.



By popular demand, here's the source. Now I hope none of you graphics students out there try to pass this off as a graphics assignment ;-). (My original Visual Basic application was a graphics course assignment)

Hey, I'm feeling crazy -- if you've got Windows 3.1 or Windows95 and the Visual Basic 3.0 runtime DLL, download the original executable.

Go back to my home page.

heinrica@cs.sfu.ca